#! /bin/sh

#####  Define/display a triangulated model and 
#####  convert it in a gridded mesh

#####  Data directory
#SCRATCH=/home/user1/Scratch
SCRATCH=.

file=$SCRATCH/elamod

#####  Path to executables
#B=${HOME}/Release/Rays/bin

##### Define PostScriptViewer
PSPREVIEW=ghostview

elamodel xmin=0 zmin=0 xmax=20.0 zmax=10.0 maxangle=5 \
1       xedge=0.0,5.0,10.0,15.0,20.0 \
	zedge=0.0,0.0,0.0,0.0,0.0 \
2       xedge=0.0,5.0,10.0,15.0,20.0 \
	zedge=0.0,0.8,0.0,0.6,0.0 \
3 	xedge=0.00,5.20,10.00,20.00 \
	zedge=2.5,2.40,2.80,2.4 \
4       xedge=0.00,2.00,10.00 \
	zedge=5.00,4.80,2.80 \
5       xedge=7.00,10.50,15.00 \
	zedge=5.30,4.50,5.00 \
6       xedge=7.00,10.50,15.00 \
	zedge=5.30,5.30,5.00 \
7       xedge=2.00,10.00,20.00 \
	zedge=4.80,6.50,6.50 \
8       xedge=0.00,8.00 \
	zedge=9.00,8.00 \
9       xedge=8.00,8.50 \
	zedge=8.00,9.50 \
10      xedge=8.50,20.00 \
	zedge=9.50,9.00 \
11      xedge=0.00,20.00 \
	zedge=10.00,10.00 \
kedge=1,2,3,4,5,6,7,8,9,10,11 \
v1      fill=5.0,0.10,3.5,2.0,2.7 \
v2      fill=15.0,0.10,3.5,2.0,2.8 \
v3	fill=0.01,1.01,3.6,2.0,0.15,0.2,0.0,0,3.0 \
v4      fill=0.01,3.00,3.5,2.0,0.15,0.2,0.2,0,3.0 \
v5      fill=10.0,3.5,3.65,2.2,5 \
v6      fill=10,5.00,2.35,1.8,0.2,0.4,0,2,3.1 \
v7      fill=10.0,8.00,3.7,2.8,0.15,0.2,0.1,10,3.0 \
v8      fill=5.00,9.90,3.9,2.9,0.15,0.2,0.1,10,3.0 > $file.model

# generate PostScript output of V_PO
elaps <$file.model  gtri=1 p=0\
	label1="Depth (km)" label2="Distance (km)" \
	hbox=4.0 wbox=8 gmin=0.3 gmax=0.9 \
	title="v_P0" > $file.1
$PSPREVIEW $file.1 &

# generate PostScript output of Thomsen's epsilon
elaps <$file.model  gtri=1 p=2\
	label1="Depth (km)" label2="Distance (km)" \
	hbox=4.0 wbox=8 gmin=0.3 gmax=0.9 \
	title="eps" > $file.2
$PSPREVIEW $file.2 &

elatriuni <$file.model a1111file=$file.a1111 \
	a3333file=$file.a3333 a1133file=$file.a1133 \
	a1313file=$file.a1313 file a1113file=$file.a1113 \
	a3313file=$file.a3313 file a1212file=$file.a1212 \
	a1223file=$file.a1223 file a2323file=$file.a2323 \
	rhofile=$file.rho \
	nx=200 nz=100 dz=0.1 dx=0.1



psimage <$file.a1111 n1=100 n2=200 style=seismic \
	hbox=4.0 wbox=8 gmin=0.3 gmax=0.9\
	title="a1111" >$file.3

$PSPREVIEW $file.3 &
